package t20211227;

/**
 * @Author: DengJia
 * @Date: 2021/12/27 20:43
 * @Description: 重新抛出异常
 */

public class Rethrowing {
    public static void main(String[] args) throws Exception {
        try {
            throw new NullPointerException();
        } catch (NullPointerException e) {
            // e.printStackTrace();
            // 调用fillInStackTrace的那一行就成了异常的新发生地了。
            // throw (Exception) e.fillInStackTrace();
            throw new ArrayIndexOutOfBoundsException();
        }
    }
}
